﻿<?php
/**
 * @package Joomla
 * @subpackage Jmonoslideshow
 * @copyright (C) 2010 - Matthieu BARBE - www.ccomca.com
 * @license GNU/GPL v2
 * 
 * Jmonoslideshow is a Joomla extension for Monoslideshow.
 *
 * Jmonoslideshow uses :
 * Monoslideshow (http://www.monoslideshow.com/)
 * Plupload (http://www.plupload.com/) by Moxicode Systems
 * json class by Michal Migurski, Matt Knapp, Brett Stimmerman
 * jquery a JavaScript Library (http://jquery.com/)
 * getid3 library (http://getid3.sourceforge.net/)
 * swfobject is an easy-to-use and standards-friendly method to embed Flash content, which utilizes one small JavaScript file (http://code.google.com/p/swfobject/)
 * Chained Selects jQuery Plugin (http://www.appelsiini.net/2010/jquery-chained-selects)
 *
 * Jmonoslideshow is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

//load css
JHTML::stylesheet( 'monoslideshow.css', 'administrator/components/com_jmonoslideshow/assets/css/' );
JHTML::stylesheet( 'jquery-ui.custom.css', 'administrator/components/com_jmonoslideshow/assets/css/Aristo/' );

JHTML::script( 'jquery.min.js', 'administrator/components/com_jmonoslideshow/assets/js/' );
JHTML::script( 'jquery-ui.custom.min.js', 'administrator/components/com_jmonoslideshow/assets/js/' );

$script=<<<EOB

jQuery.noConflict();
jQuery(function() {
	
	jQuery(function() {
		jQuery( "#slider" ).slider({
			value:1,
			min: 0,
			max:10,
			step: 1,
			slide: function( event, ui ) {
				jQuery( "#amount" ).val( ui.value );
			}
		});
		jQuery( "#amount" ).val( jQuery( "#slider" ).slider( "value" ) );
		});
	
	
	jQuery( "#tabs" ).tabs();
	jQuery( "#global, #caption, #control, #navigation" ).accordion({
			autoHeight: false,
			navigation: true
		});
	
	
	
	
	jQuery( ".information" ).button({
            icons: {
                primary: "ui-icon-info"
            },
            text: false
        }).click(function() {
					
					jQuery( "#dialog-information" ).dialog( "open" );
					return false;

				});
	jQuery( "#dialog-information" ).dialog({
			autoOpen: false,
			resizable: true,
			height:380,
			width:550,
			modal: true,
			buttons: {
				"Fermer": function() {
					jQuery( this ).dialog( "close" );
				}
			}
		
		});
		
});

EOB;

$doc = &JFactory::getDocument();									 
$doc->addScriptDeclaration($script);


$db =& JFactory::getDBO();
$nullDate 		= $db->getNullDate();
$params = &JComponentHelper::getParams( 'com_jmonoslideshow' );
jimport('joomla.environment.uri' );

?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
	var form = document.adminForm;
	if (pressbutton == 'cancel') {
		submitform( pressbutton );
		return;
	}
	if (form.title.value == ""){
		alert( "<?php echo JText::_( 'COM_JMONOSLIDESHOW_YOU_MUST_ENTER_A_TITLE' );  ?>" );
	}
	
	
	else {
		submitform( pressbutton );
	}
}
</script>

<form action="index.php" method="post" name="adminForm" id="adminForm" >
  <table cellspacing="0" cellpadding="0" border="0" width="100%">
    <tr>
      <td><h3><?php echo $this->model->title;?></h3></td>
      <td><a class="information" href="javascript:;"><?php echo JText::_( 'COM_JMONOSLIDESHOW_INFORMATION' ); ?></a></td>
    </tr>
  </table>
  <div id="tabs">
  <ul>
    <li><a href="#tabs-1"><?php echo JText::_( 'COM_JMONOSLIDESHOW_GLOBAL' ); ?></a></li>
    <li><a href="#tabs-2"><?php echo JText :: _('COM_JMONOSLIDESHOW_CAPTION'); ?></a></li>
    <li><a href="#tabs-3"><?php echo JText :: _('COM_JMONOSLIDESHOW_CONTROL'); ?></a></li>
    <li><a href="#tabs-4"><?php echo JText :: _('COM_JMONOSLIDESHOW_NAVIGATION'); ?></a></li>
  </ul>
  <div id="tabs-1">
    <div id="global">
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_FIRST' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <table class="admintable">
            <tr>
              <td width="100" align="right" class="key"><label for="title"> <?php echo JText::_( 'COM_JMONOSLIDESHOW_TITLE' ); ?>: </label></td>
              <td><input class="text_area" type="text" name="title" id="title" size="32" maxlength="250" value="<?php echo $this->model->title;?>" /></td>
            </tr>
            <tr>
              <td width="100" align="right" class="key"><label for="description"> <?php echo JText::_( 'COM_JMONOSLIDESHOW_DESCRIPTION' ); ?>: </label></td>
              <td><textarea name="description" cols="30" rows="10"><?php echo $this->model->description;?></textarea></td>
            </tr>
            <?php if (!$this->isNew) : ?>
            <tr>
              <td width="100" align="right" class="key"><label for="published"> <?php echo JText::_( 'COM_JMONOSLIDESHOW_PUBLISHED' ); ?> </label></td>
              <td><?php echo $this->lists['published']; ?></td>
            </tr>
            <?php endif ?>
          </table>
          <?php echo $this->params->render('params', 'first'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_MAIN_PROPERTIES' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'global'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_TRANSITION_AND_EFFECT_CONFIGURATION' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'effects'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_LINK_CONFIGURATION' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'link'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_MARK' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'mark'); ?>
        </fieldset>
      </div>
    </div>
  </div>
  <div id="tabs-2">
    <div id="caption">
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_CAPTION_CONFIGURATION' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'caption'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_CAPTION_TITLE' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'caption-title'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_CAPTION_DESCRIPTION' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'caption-description'); ?>
        </fieldset>
      </div>
    </div>
  </div>
  <div id="tabs-3">
    <div id="control">
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_CONTROL_CONFIGURATION' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'control'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_ICONS_CONFIGURATION' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'icons-control'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_SHOW_SCRUB_BAR' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'scrub'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_PROGRESS_CONTROL' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'progress'); ?>
        </fieldset>
      </div>
    </div>
  </div>
  <div id="tabs-4">
    <div id="navigation">
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_NAVIGATION_CONFIGURATION' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'navigation'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_PERMANENT_NAVIGATION' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'permanent-navigation'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_PERMANENT_NAVIGATION_ITEMS' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'permanent-navigation-items'); ?>
        </fieldset>
      </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_PERMANENT_NAVIGATION_ITEMS_HOVER' ); ?></a></h3>
      <div>
        <fieldset class="panelform">
          <?php echo $this->params->render('params', 'permanent-navigation-items-hover'); ?>
        </fieldset>
      </div>
    </div>
  </div>
   </div>
  <div class="clr"></div>
  <input type="hidden" name="option" value="com_jmonoslideshow" />
  <input type="hidden" name="id" value="<?php echo $this->model->id; ?>" />
  <input type="hidden" name="task" value="" />
  <input type="hidden" name="controller" value="model" />
  <?php echo JHTML::_( 'form.token' ); ?>
</form>
<div id="dialog-information" title="<?php echo JText::_( 'COM_JMONOSLIDESHOW_INFORMATION' ); ?>" style="display:none;" >
  <p>
  <table>
    <tr>
      <td nowrap="nowrap"><label for="created"><?php echo JText::_('COM_JMONOSLIDESHOW_MEDIA_CREATED') ?> :</label></td>
      <td width="100%"><?php
				if ( $this->model->created == $nullDate ) {
					echo JText::_( 'COM_JMONOSLIDESHOW_NEW_MEDIA' );
				} else {
					echo JHTML::_('date',  $this->model->created,  JText::_('DATE_FORMAT_LC2') );
				}
				?></td>
    </tr>
    <tr>
      <td><label for="author"><?php echo JText::_('COM_JMONOSLIDESHOW_AUTHOR') ?> : </label></td>
      <td><?php
        $author =& JFactory::getUser($this->model->author);
		echo $author->name;
		

		?></td>
    </tr>
    <tr>
      <td nowrap="nowrap"><label for="modified"><?php echo JText::_('COM_JMONOSLIDESHOW_MEDIA_MODIFIED') ?> :</label></td>
      <td width="100%"><?php
				if ( $this->model->modified == $nullDate ) {
					echo JText::_( 'COM_JMONOSLIDESHOW_NEW_MEDIA' );
				} else {
					echo JHTML::_('date',  $this->model->modified,  JText::_('DATE_FORMAT_LC2') );
				}
				?></td>
    </tr>
    <tr>
      <td><label for="modified_by"><?php echo JText::_('COM_JMONOSLIDESHOW_MODIFIED_BY') ?> : </label></td>
      <td><?php
        $modified_by =& JFactory::getUser($this->model->modified_by);
		echo $modified_by->name;
		

		?></td>
    </tr>
    <tr>
      <td><label for="modified_by"><?php echo JText::_('COM_JMONOSLIDESHOW_DESCRIPTION') ?> : </label></td>
      <td><?php
        
		echo $this->model->description;
		

		?></td>
    </tr>
  </table>
  </p>
</div>
